<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            position: relative;
            width: 300px;
            height: 50px;
            border: 1px solid #333;
        }

        .box::after {
            position: absolute;
            right: 20px;
            top: 15px;
            content: '';
            width: 10px;
            height: 10px;
            border: 1px solid #333;
            border-top: 0;
            border-left: 0;
            /* 旋转45deg */
            transform: rotate(45deg);
            transition: all .3s;
        }

        .box:hover::after {
            top: 20px;
            transform: rotate(225deg);
        }
    </style>
</head>

<body>
    <div class="box"></div>
</body>

</html>